package com.vitaf.cash.app.common

import android.content.Context
import android.view.View
import com.vitaf.cash.app.base.popup.VitafBasePopup

class VitafComPopup : VitafBasePopup<VitafComPopup> {

    private var onViewListener: OnViewListener? = null

    constructor() : super()

    constructor(context: Context) : super() {
        setContext(context)
    }

    companion object {
        @JvmStatic
        fun create(): VitafComPopup {
            return VitafComPopup()
        }

        @JvmStatic
        fun create(context: Context): VitafComPopup {
            return VitafComPopup(context)
        }
    }

    override fun initAttributes() {
        // 空实现，由子类根据需要重写
    }

    override fun initViews(view: View, popup: VitafComPopup) {
        onViewListener?.initViews(view, popup)
    }

    fun setOnViewListener(listener: OnViewListener): VitafComPopup {
        this.onViewListener = listener
        return this
    }

    fun interface OnViewListener {
        fun initViews(view: View, popup: VitafComPopup)
    }
}
